package com.hymjweb.demo.hymj.customer_manage.freight_agreement.detail.bean;

import com.hymjweb.demo.framework.util.pojoContrast.FieldMeta;
import lombok.Data;

import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * @BelongsProject: demo
 * @BelongsPackage: com.hymjweb.demo.hymj.customer_manage.freight_agreement.detail.bean
 * @Author: luoge
 * @CreateTime: 2021-01-21 17:53
 * @Description:
 * Comparable<BCustomerFeightAgreementDetailPojo>
 */

@Table(name = "b_customer_auto_freight_agreement")
@Data
public class BCustomerFeightAgreementDetailPojo implements Serializable {

    @FieldMeta(columnname = "id", name = "客户协议运价明细ID", comment = "客户协议运价明细ID")
    private String id;

    @FieldMeta(columnname = "agreement_freight_type_id", name = "客户协议运价类型ID", comment = "客户协议运价类型ID,关联xt_dic.id key=XT_DIC_TRANSPORT_SPECIES")
    private Long agreementFreightTypeId;

    @FieldMeta(columnname = "agreement_freight_id", name = "客户协议运价ID", comment = "客户协议运价ID,关联b_customer_auto_freight_agreement.id或b_customer_air_freight_agreement.id")
    private String agreementFreightId;

    @FieldMeta(columnname = "standard_type_id", name = "客户协议运价标准分类ID", comment = "客户协议运价标准分类,关联XT_DIC.ID KEY=XT_DIC_CUSTOMER_AGREEMENT_FREIGHT_STANDARD")
    private Long standardTypeId;

    @FieldMeta(columnname = "goods_type_id", name = "货物类型ID", comment = "货物类型ID,关联XT_DIC.ID KEY=XT_DIC_GOODS_TYPE")
    private Long goodsTypeId;

    @FieldMeta(columnname = "start_value", name = "起始值", comment = "起始值")
    private Integer startValue;

    @FieldMeta(columnname = "end_value", name = "结束值", comment = "结束值")
    private Integer endValue;

    @FieldMeta(columnname = "price", name = "单价", comment = "单价(元/公斤)")
    private Double price;

    @FieldMeta(columnname = "comment", name = "备注", comment = "备注")
    private String comment;


//    @Override
//    public int compareTo(BCustomerFeightAgreementDetailPojo o) {
//        int standardCompareValue = this.standardTypeId.compareTo(o.standardTypeId);
//        int startValueCompareValue = this.startValue.compareTo(o.startValue);
//        // 将每个字段的比较结果按优先级加权求和，就是两个对象的比较结果了。
//        int compareResult = standardCompareValue * 10 + startValueCompareValue;
//        // 将最终结果规约成 1、0、-1 三者中的一个。
//        return Integer.compare(compareResult,0);
//    }
}
